package com.mimosa.common.system.login;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.mimosa.common.entity.BaseEntity;
import com.mimosa.common.system.user.TUser;

/**
 * 登录信息的实体类
 * 
 * @filename TLogin.java
 * @author ggeagle
 * @date 2013-7-14 下午10:20:16
 */
@Entity
@Table(name = "T_LOGIN_INFO")
public class TLogin extends BaseEntity {
	/**
	 * 用户主键
	 */
	@Column(nullable = false, length = 32)
	private String userId;
	/**
	 * 登录者的IP
	 */
	@Column(nullable = false, length = 16)
	private String loginIp;

	@Transient
	private TUser user;

	@Transient
	private Long numCount;

	public TLogin() {
	}

	public TLogin(String userId, Date loginTime, Long numCount) {
		this.setUserId(userId);
		this.setNumCount(numCount);
		this.setCreateTime(loginTime);
	}

	public Long getNumCount() {
		return numCount;
	}

	public void setNumCount(Long numCount) {
		this.numCount = numCount;
	}

	public TUser getUser() {
		return user;
	}

	public void setUser(TUser user) {
		this.user = user;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getLoginIp() {
		return loginIp;
	}

	public void setLoginIp(String loginIp) {
		this.loginIp = loginIp;
	}
}